package com.diaohw.module.metadata.obj.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.diaohw.platform.framework.db.obj.BaseModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serial;

/**
 * <p>
 * 元数据属性值
 * </p>
 *
 * @author D-Hw
 * @since 2025-04-08
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("META_DATA")
@Schema(name = "MetaDataDO", description = "元数据属性值")
public class MetaDataDO extends BaseModel<MetaDataDO> {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 数据ID
     */
    @Schema(description = "数据ID")
    @TableField("DATA_ID")
    private String dataId;

    /**
     * 本条记录ID
     */
    @Schema(description = "本条记录ID")
    @TableField("ROW_ID")
    private String rowId;

    /**
     * 层级
     */
    @Schema(description = "层级")
    @TableField("LEVEL_")
    private Integer level;

    /**
     * 元数据ID
     */
    @Schema(description = "元数据ID")
    @TableField("META_ID")
    private String metaId;

    /**
     * 元数据CODE
     */
    @Schema(description = "元数据CODE")
    @TableField("META_CODE")
    private String metaCode;

    /**
     * 属性名称
     */
    @Schema(description = "属性名称")
    @TableField("ITEM_ID")
    private String itemId;

    /**
     * 属性CODE
     */
    @Schema(description = "属性CODE")
    @TableField("ITEM_CODE")
    private String itemCode;

    /**
     * 参数值
     */
    @Schema(description = "参数值")
    @TableField("VAL_")
    private String val;

    public static MetaDataDO of(String dataId, String rowId, Integer level, String metaId, String metaCode, String itemId, String itemCode) {
        MetaDataDO data = new MetaDataDO();
        data.dataId = dataId;
        data.rowId = rowId;
        data.level = level;
        data.metaId = metaId;
        data.metaCode = metaCode;
        data.itemId = itemId;
        data.itemCode = itemCode;
        return data;

    }

}
